using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
using ESOL.Common.Entity;
using ESOL.Business.Mst;

namespace ESOL.WinUI.Inv
{
    public partial class frmPrintTemplateInvImportOrder : DevExpress.XtraReports.UI.XtraReport
    {
        public frmPrintTemplateInvImportOrder(DataRow drOrder, DataTable dtOrderDetail)
        {
            InitializeComponent();
            this.DataSource = dtOrderDetail;
            labOrderCode.Text = drOrder["ORDER_CODE"].ToString();
            MstCommonItemEntity mImportTypeEntity = MstCommonItemBs.GetMstCommonItemByCode(drOrder["ORDER_TYPE"].ToString());
            labImportType.Text = mImportTypeEntity.ItemName;
            labRequestDate.Text = drOrder["ORDER_DATE"].ToString();
            balRequestPerson.Text = drOrder["NAME_CN_ORDER"].ToString();
            labApprovePerson.Text = drOrder["NAME_CN_APPROVED"].ToString();
            labApproveDate.Text = drOrder["APPROVED_DATE"].ToString();
            MstCommonItemEntity mStatusEntity = MstCommonItemBs.GetMstCommonItemByCode(drOrder["STATUS"].ToString());
            labOrderStatus.Text = mStatusEntity.ItemName;
            labRemark.Text = drOrder["REMARK"].ToString();

            xrt1.DataBindings.Add("Text", dtOrderDetail, "WAREHOUSE_NAME_P");
            xrt2.DataBindings.Add("Text", dtOrderDetail, "LOCATION_CODE_P");
            xrt3.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_SPEC_OUT_S");
            xrt4.DataBindings.Add("Text", dtOrderDetail, "PLAN_ORDER_CODE");
            xrt5.DataBindings.Add("Text", dtOrderDetail, "ORDER_ITEM_CODE");
            xrt6.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_CODE");
            xrt7.DataBindings.Add("Text", dtOrderDetail, "PRODUCT_NAME");
            xrt8.DataBindings.Add("Text", dtOrderDetail, "DESCRIPTION");
            xrt9.DataBindings.Add("Text", dtOrderDetail, "QTY");
            xrt10.DataBindings.Add("Text", dtOrderDetail, "WAREHOUSE_NAME");
            xrt11.DataBindings.Add("Text", dtOrderDetail, "LOCATION_CODE");
            xrt12.DataBindings.Add("Text", dtOrderDetail, "REMARK");
        }

    }
}
